/**
 * 
 */
package myth.cc.file;

import java.io.*;

/**
 * @author Biao Zhang
 * 
 */
public class SourceFileReader {
	private String fileName = null;
	
	public SourceFileReader(String fileName) {
		this.fileName = fileName;
	}
	
	public String getSource() throws IOException {
		StringBuffer buf = new StringBuffer();
		BufferedReader f = new BufferedReader(new FileReader(fileName));
		String temp;
		while ((temp = f.readLine()) != null) {
			temp += "\n";
			buf.append(temp);
		}
//		System.out.println(buf.toString());
		return buf.toString();
	}

	public static void main(String[] args) throws IOException {
		SourceFileReader r = new SourceFileReader("src/myth/cc/file/SourceFileReader.java");
		r.getSource();
	}
}
